#ifndef ACTIVITY_LIST_VIEW_H
#define ACTIVITY_LIST_VIEW_H

#include <QDialog>

#include "view_base.h"
#include "result_processor.h"
#include "data_types.h"

namespace Ui {
    class ActivityListView;
}

class QListWidgetItem;
class ActivityView;

class ActivityListView : public ViewBase, ResultProcessor
{
    Q_OBJECT

public:
    explicit ActivityListView(QWidget *parent = 0);
    virtual ~ActivityListView();

    virtual void IssueRequest();

    inline void SetCategory(cate c) {
      category_ = c;
    }

  protected:
    virtual int ProcessResult(RequestMethod &r, QDomElement &e);

  private:
    int parse_result(QDomElement &e);
    int parse_activities(QDomElement &e);

  public slots:
    void showActivity(QListWidgetItem *item);

private:
    Ui::ActivityListView *ui;
    cate category_;

    QVector<activity> activities_;

    ActivityView *activityView_;
};

#endif // ACTIVITY_LIST_VIEW_H
